import { createApp } from 'vue'

import Cookies from 'js-cookie'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import locale from 'element-plus/es/locale/lang/zh-cn'
// import VScaleScreen from 'v-scale-screen';

// import '@/assets/styles/global.scss' // global css

import App from './App'
import store from './store'
import router from './router'
import ECharts from 'vue-echarts'
import 'echarts'
import { resetForm } from '@/utils/ruoyi'
import { fitChartSize } from '@/dataUtil/echartFont'
import {vue3ScrollSeamless} from "vue3-scroll-seamless";

const app = createApp(App)

// 全局挂栽方法
app.config.globalProperties.resetForm = resetForm
app.config.globalProperties.fitChartSize = fitChartSize

/* 使用方法
const { proxy } = getCurrentInstance()
proxy.resetForm("queryRef")
*/

// 全局组件挂载
// app.component('VScaleScreen', VScaleScreen)

app.use(router)
app.use(store)
app.component('ECharts', ECharts)
// 注册 Vue3 Scroll Seamless 组件
app.component('vue3ScrollSeamless',vue3ScrollSeamless)

// 使用element-plus 并且设置全局的大小
app.use(ElementPlus, {
  locale: locale,
  // 支持 large、default、small
  size: Cookies.get('size') || 'default'
})

app.mount('#app')
